/*
 * @Author: your name
 * @Date: 2021-12-29 17:38:11
 * @LastEditTime: 2022-01-17 08:35:17
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \my-site\src\router\index.js
 */
import VueRouter from "vue-router" //引入路由
import Vue from "vue" //需要注册组件
import routes from "./routes" //匹配规则

Vue.use(VueRouter) //使用组件

const router = new VueRouter({
  routes,
  mode:'history',
})

router.afterEach((to, from) => {
  if(to.meta.title){
    document.title = to.meta.title
  }
})

export default router //导出路由实例